﻿using BCCommon;
using BCDto.WeChatComponent.WeChatNewsImageRecord;
using BCService.WeChatComponent.WeChatNewsImageRecordService;
using Microsoft.AspNetCore.Mvc;

namespace BCTMSRESTful.Controllers.Management.WeChat
{
    /// <summary>
    /// 微信图文文内图片记录控制器
    /// </summary>
    [ApiExplorerSettings(GroupName = "Admin")]
    [Route("api/v1/sim/[controller]")]
    public class WeChatNewsImageRecordController : ManagementBaseController
    {
        private readonly IWeChatNewsImageRecordService weChatNewsImageRecordService;

        public WeChatNewsImageRecordController(IWeChatNewsImageRecordService weChatNewsImageRecordService)
        {
            this.weChatNewsImageRecordService = weChatNewsImageRecordService;
        }

        /// <summary>
        /// 获取微信图文文内图片记录（带分页）。
        /// </summary>
        /// <param name="index">当前页码</param>
        /// <param name="size">每页数据条数</param>
        /// <response code="200">获取的微信素材信息列表。</response>
        /// <returns></returns>
        [HttpGet]
        [ProducesResponseType(typeof(PageableList<WeChatNewsImageRecordDto>), 200)]
        public IActionResult Get([FromQuery(Name = "index")]int index = 1,
            [FromQuery(Name = "size")]int size = 10)
        {
            return this.Ok(this.weChatNewsImageRecordService.Get(null,null,false, index, size));
        }
    }
}
